﻿<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    Inherits="Nivdal.AdministerForum"
    StylesheetTheme="SkinFile" CodeBehind="AdministerForum.aspx.cs" %>

<%@ MasterType VirtualPath="~/MasterPage.master" %>
<asp:Content ID="PageNameContent" ContentPlaceHolderID="PageNamePlaceHolder" runat="server">
    <asp:Label ID="PageNameLabel" runat="server" Text="<%$ Resources:Resource, AdministerForum_PageNameLabel %>"
        CssClass="PageNameContentStyle"></asp:Label>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="basic_element">
    <div class="red_title">
       <asp:Label ID="forumNameTitleLabel" runat="server" Text='<%$ Resources:Resource, Global_ForumName %>' CssClass="white_title""></asp:Label>

    </div>
    <div class="padding5">

        <asp:HiddenField ID="ForumIdHiddenField" runat="server" />
        <asp:Label ID="MessageLabel" runat="server" Text="" SkinID="GreenSmallHeaderLabel"></asp:Label>
        <br />
        <asp:TextBox ID="ForumNameTextBox" runat="server" MaxLength="128" Width="94px" Font-Names="Arial"
            Font-Size="12px"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ValidationGroup="AdministerForum"
            ErrorMessage="<%$ Resources:Resource, AdministerForum_RequiredFieldValidator1 %>"
            ControlToValidate="ForumNameTextBox">
        </asp:RequiredFieldValidator>
        <%--     <cc1:ValidatorCalloutExtender ID="RequiredFieldValidator1Extender" WarningIconImageUrl="Images/001_111.png"
                       CloseImageUrl="Images/001_051.png" CssClass="customCalloutStyle" runat="server" 
                       TargetControlID="RequiredFieldValidator1" PopupPosition="TopLeft">
                    </cc1:ValidatorCalloutExtender>--%>
        <br />
        <br />
        <asp:Label ID="PublicInfoTitleLabel" runat="server" Text="<%$ Resources:Resource, AdministerForum_PublicInfoTitleLabel %>"
            SkinID="InfoLabel"></asp:Label>
        <br />
        <CustomControls:TextArea runat="server" ID="PublicInfoTextArea" MaxLength="256" TextMode="MultiLine"
            Rows="5" Height="50px" Width="160px" Font-Names="Arial" Font-Size="12px"></CustomControls:TextArea>
        <br />
        <br />
        <asp:Label ID="PrivateInfoTitleLabel" runat="server" Text="<%$ Resources:Resource, AdministerForum_PrivateInfoTitleLabel %>"
            SkinID="InfoLabel"></asp:Label>
        <br />
        <CustomControls:TextArea runat="server" ID="PrivateInfoTextArea" MaxLength="256"
            TextMode="MultiLine" Rows="5" Height="50px" Width="160px" Font-Names="Arial"
            Font-Size="12px"></CustomControls:TextArea>
        <br />
        <br />
        <asp:Button ID="SaveButton" runat="server" Text="<%$ Resources:Resource, AdministerForum_SaveButton %>"
            ValidationGroup="AdministerForum" CssClass="GreenButtonTextStyle" OnClick="SaveButton_Click" />
        <br />
        <br />
        <asp:Panel ID="ApplicationsPanel" runat="server">
            <asp:Label ID="ApplicationsTitleLabel" runat="server" Text="<%$ Resources:Resource, AdministerForum_ApplicationsTitleLabel %>"
                SkinID="InfoLabel"></asp:Label>
            <br />
            <asp:GridView ID="MembershipApplicationsGridView" runat="server" DataSourceID="MembershipApplicationsSqlDataSource"
                SkinID="Professional" AutoGenerateColumns="False" AllowPaging="True" OnRowCommand="AdminMemberShip"
                OnRowCreated="MembershipApplicationsGridView_OnRowCreated" Font-Size="13px" Font-Names="Arial"
                EnableTheming="True">
                <PagerSettings FirstPageText="<%$ Resources:Resource, FirstPage %>" LastPageText="<%$ Resources:Resource, LastPage %>"
                    Mode="NumericFirstLast" PageButtonCount="10" Position="Bottom" />
                <PagerStyle CssClass="pagination" HorizontalAlign="Center" />
                <Columns>
                    <asp:BoundField DataField="ApplicationId" />
                    <asp:TemplateField>
                        <HeaderTemplate>
                            <asp:Label ID="PlayersLabel" runat="server" Text="<%$ Resources:Resource, AdministerForum_PlayersLabel %>"></asp:Label>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:HyperLink ID="PlayersHyperLink" runat="server" Text='<%# Eval("UserName") %>'
                                NavigateUrl='<%# Eval("UserId", "UserPage.aspx?Id={0}") %>' SkinID="BlackHyperLinkSkin"></asp:HyperLink>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="Type" HeaderText="<%$ Resources:Resource, AdministerForum_TypeHeader %>" />
                    <asp:BoundField DataField="ApplicationDate" HeaderText="<%$ Resources:Resource, AdministerForum_ApplicationDateHeader %>" />
                    <asp:BoundField DataField="ApplicationNote" HeaderText="<%$ Resources:Resource, AdministerForum_ApplicationNote %>" />
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:LinkButton ID="ApproveApplicationLinkButton" runat="server" OnClientClick='<%# ApproveLinkButtonOnClientClick()%>'
                                CommandArgument="<%#((GridViewRow) Container).RowIndex %>" CommandName="Approve"
                                Text="Approve" SkinID="TitleLink"></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:LinkButton ID="DeclineApplicationLinkButton" runat="server" OnClientClick='<%# DeclineApplicationButtonOnClientClick()%>'
                                CommandArgument="<%#((GridViewRow) Container).RowIndex %>" CommandName="Decline"
                                Text="Decline" SkinID="TitleLink"></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <asp:SqlDataSource ID="MembershipApplicationsSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                SelectCommand="Nivdal_ForumGetForumApplicationsList" SelectCommandType="StoredProcedure">
            </asp:SqlDataSource>
        </asp:Panel>
        <br />
        <br />
        <asp:GridView  ID="ExpelUserGridView" runat="server" DataSourceID="ExpelUserSqlDataSource"
            SkinID="Professional" AutoGenerateColumns="False" AllowPaging="True" OnRowCommand="AdminExpelUser"
            PageSize="20" >

            <Columns>
            
                <asp:TemplateField>
                    <HeaderTemplate>
                        <asp:Label ID="PlayersLabel" runat="server" Text="<%$ Resources:Resource, AdministerForum_PlayersLabel %>"></asp:Label>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:HyperLink ID="PlayersHyperLink" runat="server" Text='<%# Eval("UserName") %>'
                            NavigateUrl='<%# Eval("UserId", "UserPage.aspx?Id={0}") %>' SkinID="BlackHyperLinkSkin"></asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="MembershipType" >
                    <ItemTemplate>
                        <asp:Label ID="MembershipTypeLabel" runat="server" SkinID="GridLabel" Text='<%# Eval("MembershipType") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:LinkButton ID="ExpelLinkButton" runat="server" OnClientClick='<%# ExpelLinkButtonOnClientClick()%>'
                          CommandName="Expel" CommandArgument='<%# Eval("UserId") %>'
                            Text="<%$ Resources:Resource, AdministerForum_ExpelLinkButtonl %>" SkinID="TitleLink"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <EmptyDataTemplate>
                <asp:Label ID="EmptyDataTemplateLabel" runat="server" Text="<%$ Resources:Resource, AdministerForum_EmptyDataTemplateLabel %>"></asp:Label>
            </EmptyDataTemplate>
        </asp:GridView>
        <asp:SqlDataSource ID="ExpelUserSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="Nivdal_ForumGetForumMembers" SelectCommandType="StoredProcedure">
        </asp:SqlDataSource>
        <br />
        <br />
        <asp:HyperLink ID="BackToTheForumHyperLink" Text="<%$ Resources:Resource, Global_BackToForum %>"
            runat="server" SkinID="GreenTitleHyperLink"></asp:HyperLink>
     </div>
    </div>
</asp:Content>
